#!/bin/bash

problems=(
    "102. 二叉树的层序遍历"
    "103. 二叉树的锯齿形层序遍历"
    "107. 二叉树的层序遍历 II"
    "111. 二叉树的最小深度"
    "752. 打开转盘锁"
    "773. 滑动谜题"
)

for prob in "${problems[@]}"; do
    num=$(echo $prob | grep -oE '^[0-9]+')
    title=$(echo $prob | sed "s/$num//g" | xargs)
    # 移除标题中的点号
    title=${title//./}
    filename="LC_${num}_${title// /_}.java"
    cat > $filename <<EOF
package org.labuladong.暴力搜索算法.回溯算法;

/**
 * @Author: qingle
 * @Date: 2024/10/28-16:11
 * @Description: $prob
 * @version: 1.0
 */
public class LC_${num}_${title// /_} {
}
EOF
done